#ifndef UTIL_H_
#define UTIL_H_

#include "scnedit.h"
#include <iostream>
#include <fstream>
using namespace irr;


#define SAY printf
#define WARN printf

/*
template<class T>
  for_each(T first, T last, Function f)
  {
    for ( ; first!=last; ++first ) f(*first);
    return f;
  }
  */




//from furrycat's
int str_equals(char *one, char *two);
int str_nequals(char *one, char *two,int n);
int str_equiv(const char *one, const char *two);

void error(bool fatal, char * message,...);

void read_generic(void * buffer, std::ifstream* file, int nbytes);

u32 read_u32(std::ifstream* file);

s32 read_s32(std::ifstream* file);

u16 read_u16(std::ifstream* file);

s16 read_s16(std::ifstream* file);

f32 read_f32(std::ifstream* file);

bool CopyFile_(const char * existfile, const char * newfile);

#endif
